
// Replication Data for "Ethnicity and Power in Sub-Saharan Africa: Do Colonial Institutions Still Matter?" //

   
*********************************Table and Graphs*******************************

// Figure 1 Frequency of Types of Executive Power by Decade //

/* file: Colonial+DemocComplete.dta */

ta year
gen dec=.
replace dec=1 if year>1959 & year<1980
replace dec=2 if year>1969 & year<1980
replace dec=3 if year>1979 & year<1990
replace dec=4 if year>1989 & year<2000
replace dec=5 if year>1999
graph bar (sum) monopoly (sum) dominant (sum) senior (sum) junior, by(dec)

// Table 1 Number of Observations by Colonial Category //

tab ranks      /* colonial military: 1561, 22.96% */ 
tab coff       /* officer corps: 693, 10.19% */
tab specstat   /* special administrative status: 631, 9.28% */
/* the data of special administrative status are different from those in the article */
tab cadmin     /* colonial education: 1622, 23.86% */


// Table 2 Base Models——Probability of Groups Accessing Different Forms of Executive Power (auto-regressive (ar1) logit models with colonial and country fixed effects) //

eststo clear

eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization i.colcode i.ccode, family(binomial) corr(ar1)
/* dompow, predominant, combination of dom, senior, and monopoly--could recode predom*/
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization i.colcode i.ccode, family(binomial) corr(ar1)
eststo: quietly xtgee inpwr ranks cadmin coff specstat groupsize centralization i.colcode i.ccode, family(binomial) corr(ar1)
esttab using base.csv, varwidth(25) stats(N N_g chi2, lab("Group-Year Observations" "Number of Groups" "Chi-Squared")) replace

// Table 3 Extended Models——Probability of Groups Accessing Different Forms of Executive Power (auto-regressive (ar1) logits with group-level & country-level controls, and colonial and country fixed effects) //


*all variables
eststo clear
eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem maxpop groups ethfrac islamic warhist i.colcode i.ccode, family(binomial) corr(ar1)
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem maxpop groups ethfrac islamic warhist i.colcode i.ccode, family(binomial) corr(ar1)
esttab using all1.csv, varwidth(25) stats(N N_g chi2, lab("Group-Year Observations" "Number of Groups" "Chi-Squared"))

//Table 4 Probability of Groups Accessing Predominant Executive Power by Decade (auto-regressive (ar1) logits with time-varying controls and country fixed effects) //


*decade dompow
eststo clear
eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==1, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==2, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==3, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==4, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee dompow ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==5, family(binomial) corr(ar1)tol(1)
esttab using dombydecade1.csv, varwidth(25) stats(N N_g chi2, lab("Group-Year Observations" "Number of Groups" "Chi-Squared"))

// Table 5 Probability of Groups Accessing Junior Executive Power by Decade (auto-regressive (ar1) logits with time-varying controls and country fixed effects) //

*decade junior
eststo clear
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==1, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==2, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==3, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==4, family(binomial) corr(ar1)tol(1)
eststo: quietly xtgee junior ranks cadmin coff specstat groupsize centralization nyear prevcoup gdpcap libdem i.ccode if decade==5, family(binomial) corr(ar1)tol(1)
esttab using juniorbydecade1.csv, varwidth(25) stats(N N_g chi2, lab("Group-Year Observations" "Number of Groups" "Chi-Squared"))







































